package com.example.myapplication1;

import androidx.appcompat.app.AppCompatActivity;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class PengActivity extends AppCompatActivity {
    private ImageView postpyq,userimg;
    private ListView pyqlv;
    private TextView username;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_peng);
        initView();
    }

    private void initView() {
        postpyq=findViewById(R.id.postpyq);
        pyqlv=findViewById(R.id.pyq);
        username=findViewById(R.id.username);
        userimg=findViewById(R.id.userimg);
        SharedPreferences sp=getSharedPreferences("userinfo",MODE_PRIVATE);
        userimg.setImageResource(sp.getInt("myimg",-1));
        username.setText(sp.getString("myname",""));
    }
}
